# Create your views here.
from .models import AppClassModel
from .serializers import AppClassModelSerializer, AppClassModelCreateUpdateSerializer
from dvadmin.utils.viewset import CustomModelViewSet


class AppClassModelViewSet(CustomModelViewSet):
    """
    list:查询
    create:新增
    update:修改
    retrieve:单例
    destroy:删除
    """
    queryset = AppClassModel.objects.all()
    serializer_class = AppClassModelSerializer
    create_serializer_class = AppClassModelCreateUpdateSerializer
    update_serializer_class = AppClassModelCreateUpdateSerializer
    filter_fields = ['title', 'keyword']
    search_fields = ['keyword']